/* style.css */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    padding: 30px;
}

header h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #444;
    font-size: 2.2rem;
}

.input-section {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

#taskInput {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

#taskInput:focus {
    border-color: #667eea;
}

#addTaskBtn {
    padding: 12px 24px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background 0.3s;
}

#addTaskBtn:hover {
    background: #5a6fd8;
}

.tasks-section h2 {
    margin-bottom: 20px;
    color: #555;
    font-size: 1.5rem;
}

#taskList {
    list-style: none;
    margin-bottom: 20px;
}

.task-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: background 0.3s, transform 0.2s;
}

.task-item:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
}

.task-checkbox {
    width: 20px;
    height: 20px;
    margin-right: 15px;
    cursor: pointer;
}

.task-text {
    flex: 1;
    font-size: 1.1rem;
    word-break: break-word;
}

.task-completed {
    text-decoration: line-through;
    color: #888;
}

.delete-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.delete-btn:hover {
    background: #ff5252;
}

#emptyMessage {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 40px 0;
    display: block;
}

/* 响应式设计 */
@media (max-width: 600px) {
    .container {
        padding: 20px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .input-section {
        flex-direction: column;
    }

    #addTaskBtn {
        align-self: stretch;
    }
}